package com.genexususa.eo.google.connection;

import com.genexususa.eo.google.data.GA_Account;

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: Emiliano Martinez
 * Date: 10/22/12
 * Time: 8:01 PM
 * To change this template use File | Settings | File Templates.
 */
public class Main {

    public static void main(String[] args) {



        /*String file = "<GA_AccountCollection xmlns=\"L2TMediaTrunk\">\n" +
                "       <GA_Account xmlns=\"L2TMediaTrunk\">\n" +
                "              <Id>0</Id>\n" +
                "              <AccountGxId>38</AccountGxId>\n" +
                "              <Name>" + "TEST NAME" + "</Name>\n" +
                "              <CurrencyCode>"+"USD"+"</CurrencyCode>\n" +
                "              <DateTimeZone>"+"America/Chicago"+"</DateTimeZone>\n" +
                "       </GA_Account>\n" +
                "</GA_AccountCollection>\n";*/


        AccountManager am = new AccountManager();
        ArrayList<GA_Account> accounts = am.GetAllAccounts();
        am.Finalize();
        for (GA_Account account : accounts) {
            System.out.println(account);
        }

        /*String res = cm.CreateAccount(file);

        System.out.println(res);

        cm.Finalize();*/

        //ReportManager rm = new ReportManager();

        /*try {
            rm.GetCampaignSpendForClients("9459524591;1875259995;5086893751;9449464925;8280679378;6877352682;4335279431;8090551188;2445192083;2056974229;7139297327", "c:\\l2t", "20140501", "20140512", 0L, false, false);
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }*/
        /*try {
            rm.GetSpendForClients("9459524591;1875259995;5086893751;9449464925;8280679378;6877352682;4335279431;8090551188;2445192083;2056974229;7139297327", "c:\\l2t", "20140501", "20140512", 0L, false, false);
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } */

        /*rm.GetAllReportsThreadedForClients("7296664881;6564212367;7708609287;3749532414;9249936555;2159834512;9213145906;1314349887;5404385389;3134813912;4381632961;7727473163;4046938125;1424651427;3755206474;6388046129;6431563602;9997248953;7517456653;7354162618;7271953761;1417293179;7046114818;3259648263;9108441783;4864699675;4335279431;3732207224;1809137378;3985143336;1569289721;2934043378;1845874236;8835933408;2381915253;2891328179;5712241195;3655215783;9152632412;2443568232;3003461785;5831634832;5430454602;4773551169;4101994829;6024137007;7991370863;9450315322;9932737963;3080418155;6501856559;2307736334;5753565361;8481620985;5558076812;9360539024;6848767036;6057665859;4163523167;7011605210;2506010073;1893887351;8970629378;4527405067;2019162325;7304241812;7023804775;5887127429;9351013838;2007249404;9785539708;8571508912;1966484161;1673368068;6118662606;7681986869;7736924505;3375012312;7946378240;1233562229;2550782172;9061427236;8158646318;3942272680;9713287240;5117392736;5919849777;9762933581;4085109469;7397266425;7727166636;1991390932;2109936518;6083603595;7764205774;3878974251;9394474276;6714919207;3685465959;5717092585;7013817167;3994373251;9459524591;5469667124;9851304661;1798301604;7889033474;9731394461;7811247723;3317115654;3072941337;7468038090;8857833882;2418830673;2373997737;2542503590;5335988327;4185026476;2008036280;9351943482;3158188793;4233965673;2520898187;4724494735;7041520664;4944867573;7902752955;3873114718;8842695218;7807056602;4063642069;8661723039;5694025024;1783280102;7953385775;5679892522;4810475989;7137826024;3353551538;8927340083;6261930428;7007989771;6745732776;1286906485;4058433125;8043417483;6959636186;6643835582;2482552871;6077317414;5086893751;6982444585;2247244614;4009291781;4587575302;9174129065;1192246635;1345943826;3687453525;6867643974;2587758129;9055777429;7607618740;8760740623;4459029016;6744726734;9995790537;7879013036;4458123167;3110805316;9370217366;6536806920;1960483661;6309949446;2924890116;5811111336;5973261151;1875259995;9449464925;7967927926;2445192083;7139297327;9999436302;6561321261;1739210567;3795354353;4458471181;7409923967;8797153112;4429301999;2842669010;1632188491;9265163273;8594473306;4246070508;9675569816;7013217630;9635230961;7715002122;2459255461;7318973926;3184988865;3447145582;6600972590;3777255534;7611727725;4758438759;8280679378;5618651576;6697668569;6278606825;1630644157;3590365406;2275181477;2124510581;2069974865;6376550306;9699012763;7330621224;9484224395;8750937540;8927208616;6866275628;3933086263;7194413865;4175454230;2056974229;5729533220;7742628826;7406906029;8024476829;3140560783;7022029624;1614073451;8910443167;6197058342;7930449681;7023804775;7547329367;2327573302;8862333481;2415261451;5814402226;9128999267;3068155104;4876267326;8772495718;1054157271;3232733473;1651752985;7224620418;4844915465;6204115008;3395015683;5339868616;5299828604;7319174387;5943347538;5590415885;9640574071;2862631677;9124169561;6297192714;1139536977;5935173061;6747014216;3148815775;4899374553;1340030202;1171109187;5318526032;1015605761;1254104820;8653655181;3823113467;8836250263;8023427124;2799468322;9241542332;9835199206;7081500922;8210744853;1081926783;6398035583;4612743116;9408386589;3410367202;4442761963;8723662532;1130607651;5386403667;3767780522;3596400677;6157369936;8723333438;7484183959;2412335414;8774367220;9242840771;6095081371;4397913061;2712724885;4281551222;7182562234;6315934583;8506796383;7671401440;4953895106;2057030051;3753007724;9347934565;7107797040;8780248522;4436415355;8323166879;3500633359;2368965579;9278835069;8908182887;8566623289;4192963675;8378810951;5474224251;4162871485;3286195769;2524887959;4999970579;2393898026;5599805712;9010177630;9359996975;9080596381;1540483706;9079712151;1827560551;3336217651;4132604340;5936284061;9416274667;2025526875;1229307587;3723186002;2445156887;1344026720;3193457540;6941160828;7361281657;4535285506;6046120555;1576786312;5122848283;6491362971;4477650734;3881219173;8774453263;8171093504;1740509759;2248397271;4986545406;3954726577;2999399785;6608501208;9933159561;2247138538;2935835473;8493035485;2814241085;3790144426;1926502565;3044146553;4344018514;7133195706;1814113624;2873383304;2584973967;3022831406;5702849232;4733551606;2696315069;3741729506;9773779708;5308136534;2417950963;6263551275;9046601275;8938680769;7785537077;4242049302;2291350981;9586633362;1604943589;9185077361", "c:\\L2TReports", "20140412", 500L);  */


        /*ReportManager rm = new ReportManager();
        rm.GetAllReportsThreadedForClients("7296664881;6564212367;7708609287;3749532414;9249936555;2159834512;9213145906;1314349887;5404385389;3134813912;4381632961;7727473163;4046938125;1424651427;3755206474;6388046129;6431563602;9997248953;7517456653;7354162618;7271953761", "c:\\L2TReports", "20140512", 500L);*/

        /*ReportManager rm = new ReportManager();
        rm.GetAllReportsThreaded("c:\\L2TReports", "20140509", 0L);*/

        /*try {
            rm.GetCampaignReport("7319174387", "c:\\l2t", "20140312");
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }      */

        /*ReportManager rm = new ReportManager();

        try {
            rm.GetSegmentedConversionsCampaign("9785539708", "c:\\l2t", "20140501", "20140522");
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } */



        /*ReportManager rm = new ReportManager();
        rm.GetTotalReportForClient("6530926371", "c:\\l2t");*/

        /*ReportManager rm = new ReportManager();
        try {
            rm.GetCampaignReport("6530926371", "c:\\l2t", "20140515");
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } */



    }

    public static String fileToString(String file) {
        String result = null;
        DataInputStream in = null;

        try {
            File f = new File(file);
            byte[] buffer = new byte[(int) f.length()];
            in = new DataInputStream(new FileInputStream(f));
            in.readFully(buffer);
            result = new String(buffer);
        } catch (IOException e) {
            throw new RuntimeException("IO problem in fileToString", e);
        } finally {
            try {
                in.close();
            } catch (IOException e) { /* ignore it */
            }
        }
        return result;
    }

    private void OldMain(){
         /*String file = fileToString(Main.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/SubCampaign.xml");
        CampaignManager campaignManager = new CampaignManager();
        campaignManager.SetClientId("3286873012");
        campaignManager.UpdateCampaign(file);*/

        /*String file = fileToString(Main.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/AdGroup.xml");
        AdGroupManager adGroupManager = new AdGroupManager();
        adGroupManager.SetClientId("3286873012");
        adGroupManager.CreateAdGroup(file);*/

        /*String file = fileToString(Main.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/Platform.xml");
        CampaignTargetingManager campaignTargetingManager = new CampaignTargetingManager();
        campaignTargetingManager.SetClientId("3286873012");
        campaignTargetingManager.SetBidMultiplier(file);*/

        /*String file = fileToString(Main.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/Vertical.xml");
        AdGroupCriterionManager adGroupCriterionManager = new AdGroupCriterionManager();
        adGroupCriterionManager.SetClientId("3286873012");
        adGroupCriterionManager.UpdateAdGroupCriterion(file);*/
        //adGroupCriterionManager.DeleteAdGroupCriterion(Long.valueOf("10"), Long.valueOf("6927462146"));

        /*String file = fileToString(Main.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/AdImage.xml");
        AdsManager adsManager = new AdsManager();
        adsManager.SetClientId("3286873012");
        //Long ad = Long.valueOf("23224906346");
        //Long adGroup = Long.valueOf("6927462146");
        adsManager.CreateAdImage(file);*/

        /*CampaignCriterionManager campaignCriterionManager = new CampaignCriterionManager();
        campaignCriterionManager.SetClientId("3286873012");
        campaignCriterionManager.GetProximities((long)153004826);*/

        /*ReportManager reportManager = new ReportManager();
        reportManager.SetClientId("5846982689");
        reportManager.GetAllReportsForClient("5846982689", "C:\\L2T", "20131105"); */

        /*ReportManager reportManager = new ReportManager();
        reportManager.SetClientId("7271953761");
        reportManager.GetCampaignSearchReport("C:\\L2T\\Reports", "126307585", "20130901", "20130904");*/

        /*ReportManager reportManager = new ReportManager();
        reportManager.SetClientId("8025429190");
        reportManager.GetAccountSearchReport("C:\\L2T\\Reports", "20130901", "20130904");*/

        /*ReportManager reportManager = new ReportManager();
        reportManager.SetClientId("5846982689");
        reportManager.GetTotalReportForClient("5846982689", "C:\\L2T"); */


        /*String file = "<GA_FeedCollection>\n" +
                "\t<GA_Feed>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<FeedGxId>2</FeedGxId>\n" +
                "\t\t<FeedName>Sitelinks Feed</FeedName>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttGxId>11</FeedAttGxId>\n" +
                "\t\t\t\t<FeedAttName>Text</FeedAttName>\n" +
                "\t\t\t\t<FeedAttDataType>STRING</FeedAttDataType>\n" +
                "\t\t\t\t<FeedAttTypeId>1</FeedAttTypeId>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttGxId>12</FeedAttGxId>\n" +
                "\t\t\t\t<FeedAttName>URL</FeedAttName>\n" +
                "\t\t\t\t<FeedAttDataType>URL</FeedAttDataType>\n" +
                "\t\t\t\t<FeedAttTypeId>2</FeedAttTypeId>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\t\t\n" +
                "\t</GA_Feed>\n" +
                "</GA_FeedCollection>";*/


        /*String file = "<GA_FeedInstanceCollection>\n" +
                "\t<GA_FeedInstance>\n" +
                "\t\t<FeedGxId>2</FeedGxId>\t\n" +
                "\t\t<FeedId>9537618</FeedId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>23</SubCampaignGxId>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>2</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>1</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t\t<FeedAttributeId>1</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeValue>Texto</FeedAttributeValue>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>3</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>2</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeDataType>URL</FeedAttributeDataType>\n" +
                "\t\t\t\t<FeedAttributeId>2</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeValue>http://www.example.com</FeedAttributeValue>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\t\t\n" +
                "\t</GA_FeedInstance>\n" +
                "</GA_FeedInstanceCollection>";*/

        /*String file = "<GA_FeedInstanceCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedInstance xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>20</FeedGxId>\n" +
                "\t\t<FeedId>8926756</FeedId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>835</AdExtensionGxId>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>89</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>1</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>1</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>Yolanda</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>90</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>2</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>2</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>www.yolanda.com</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>URL</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>91</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>3</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>3</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>92</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>4</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>4</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\n" +
                "\t</GA_FeedInstance>\n" +
                "</GA_FeedInstanceCollection>";   */

        /*String file = "<GA_FeedInstanceCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedInstance xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>28</FeedGxId>\n" +
                "\t\t<FeedId>9537618</FeedId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>835</AdExtensionGxId>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>125</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>1</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>1</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>EMILIANO</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>126</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>2</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>2</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>http://www.emiliano.com</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>URL</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
               "\t\t\t\t<FeedAttributeGxId>127</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>3</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>3</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>128</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>4</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>4</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\n" +
                "\t</GA_FeedInstance>\n" +
                "</GA_FeedInstanceCollection>" ;    */

        /*String file = "<GA_FeedItemCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedItem xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>28</FeedGxId>\n" +
                "\t\t<FeedId>9537618</FeedId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<FeedItemId>105282138</FeedItemId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>835</AdExtensionGxId>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>125</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>1</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>1</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>EMILIANO EDITADO 2</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>126</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>2</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>2</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>http://www.emilianoEditado2.com</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>URL</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
               "\t\t\t\t<FeedAttributeGxId>127</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>3</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>3</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>128</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>4</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>4</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\n" +
                "\t</GA_FeedItem>\n" +
                "</GA_FeedItemCollection>" ;       */


        /*String file = "<GA_FeedInstanceCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedInstance xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>72</FeedGxId>\n" +
                "\t\t<FeedId>9520846</FeedId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>1063</AdExtensionGxId>\n" +
                "\t\t<FeedItemId>90281206</FeedItemId>\n" +
                "\t\t<FeedAttributes>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>296</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>1</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>1</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>buen AGE</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>297</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>2</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>2</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue>http://www.asf.com</FeedAttributeValue>\n" +
                "\t\t\t\t<FeedAttributeDataType>URL</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>298</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>3</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>3</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t\t<FeedAttribute>\n" +
                "\t\t\t\t<FeedAttributeGxId>299</FeedAttributeGxId>\n" +
                "\t\t\t\t<FeedAttributeId>4</FeedAttributeId>\n" +
                "\t\t\t\t<FeedAttributeTypeId>4</FeedAttributeTypeId>\n" +
                "\t\t\t\t<FeedAttributeValue/>\n" +
                "\t\t\t\t<FeedAttributeDataType>STRING</FeedAttributeDataType>\n" +
                "\t\t\t</FeedAttribute>\n" +
                "\t\t</FeedAttributes>\n" +
                "\t</GA_FeedInstance>\n" +
                "</GA_FeedInstanceCollection>";  */


        /*String file = "<GA_FeedCollection>\n" +
        "\t<GA_Feed>\n" +
        "\t\t<FeedTypeId>1</FeedTypeId>\n" +
        "\t\t<FeedGxId>2</FeedGxId>\n" +
        "\t\t<FeedName>Sitelinks Feed</FeedName>\n" +
        "\t\t<FeedId>9024666</FeedId>\n" +
        "\t</GA_Feed>\n" +
        "</GA_FeedCollection>"; */


       /* String file = "<GA_FeedItemCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedItem xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>20</FeedGxId>\n" +
                "\t\t<FeedId>9537618</FeedId>\n" +
                "\t\t<FeedItemId>105093138</FeedItemId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>835</AdExtensionGxId>\n" +
                "\t</GA_FeedItem>\n" +
                "</GA_FeedItemCollection>";              */

        //AdExtensionManager aem = new AdExtensionManager();

        //aem.SetClientId("8144642304");

        //aem.GetFeedsByCampaign("8144642304");

        //FeedManager fm = new FeedManager();

        //fm.SetClientId("8144642304");

        //String res = fm.GetAllFeeds();

        //String res = fm.GetFeedsByType(2);

        //String res = fm.CreateFeed(file);

        //String res = fm.AddFeedInstance(file);

        //String res = fm.AssociateFeedInstanceCampaign(9537618L, "105093138", 148267098L, 1);

        //String res = fm.UpdateFeedItems(file);

        //String res = fm.DeleteFeedItems(file);

        //fm.Finalize();


        /*ReportManager rm = new ReportManager();

        rm.GetTotalReportForClient("2445192083", "c:\\accounts");*/


        //System.out.println(res);



        //public String AssociateFeedInstanceCampaign(Long feedId, Long feedItemId, Long campaignId, int feedTypeId)

        //String res = fm.DisassociateFeedInstanceCampaign(9024666L,"69327546", 166548546L, 1);

        //String res = fm.AssociateFeedInstanceCampaign(9024666L, "69327546;69327666;69327786", 166548546L, 1);

        //String res = fm.DeleteFeed(file);


        //String res = fm.CreateFeed(file);

        //String res = fm.AddFeedInstance(file);

        //String res = fm.GetFeedItems(9024906L);

//        fm.Finalize();

        //       System.out.println(res);

        /*String file = "<GA_AccountCollection xmlns=\"L2TMediaTrunk\">\n" +
                "       <GA_Account xmlns=\"L2TMediaTrunk\">\n" +
                "              <Id>0</Id>\n" +
                "              <AccountGxId>37</AccountGxId>\n" +
                "              <Name>Test account from linux 2</Name>\n" +
                "              <CurrencyCode>USD</CurrencyCode>\n" +
                "              <DateTimeZone>America/Chicago</DateTimeZone>\n" +
                "       </GA_Account>\n" +
                "</GA_AccountCollection>\n";  */

        //System.out.println(file);

        //System.out.println(System.getProperty("file.encoding"));


        /*String file = "<GA_CampaignLocationCollection xmlns=\"L2TMediaDev2\">\n" +
                "\t<GA_CampaignLocation xmlns=\"L2TMediaDev2\">\n" +
                "\t\t<CampaignId>120473418</CampaignId>\n" +
                "\t\t<CampaignGxId>11</CampaignGxId>\n" +
                "\t\t<ProximityId>0</ProximityId>\n" +
                "\t\t<ProximityGxId>1</ProximityGxId>\n" +
                "\t\t<Address>\n" +
                "\t\t\t  <StreetAddress>1143 W Rundell St</StreetAddress>\n" +
                "              <StreetAddress2/>\n" +
                "              <CityName>Chicago</CityName>\n" +
                "              <ProvidenceName>Illinois</ProvidenceName>\n" +
                "              <ProvidenceCode>IL</ProvidenceCode>\n" +
                "              <PostalCode>60611</PostalCode>\n" +
                "              <CountryCode>US</CountryCode>\t\t\n" +
                "\t\t</Address>\n" +
                "\t\t<Latitude>41878113</Latitude>\n" +
                "\t\t<Longitude>-87629798</Longitude>\n" +
                "\t\t<Radius>15</Radius>\n" +
                "\t</GA_CampaignLocation>\n" +
                "</GA_CampaignLocationCollection>";


        CampaignCriterionManager ccm = new CampaignCriterionManager();

        ccm.SetClientId("4202486077");

        String res = ccm.CreateCampaignProximityCriterion(file);

        System.out.println(res);*/



        /*try{



        AccountManager cm = new AccountManager();
        //cm.SetClientId("2233367422");

        SessionController sc = SessionController.getInstance();
        AdWordsSession session =  sc.GetSession("");
        System.out.println("Client Login Token: " + session.getClientLoginToken());
        System.out.println("Developer Token: " + session.getDeveloperToken());
        System.out.println("Endpoint: " + session.getEndpoint());
        System.out.println("User Agent: " + session.getUserAgent());
        //System.out.println();

        String res = cm.CreateAccount(file);

        System.out.println(res);

        cm.Finalize();
        }catch(Exception exc){
            exc.printStackTrace();
            System.out.println(exc.getMessage());
        }  */

       /* AdsManager am = new AdsManager();
        am.SetClientId("1099192559");

        String res = am.DeleteAd("36873165979;36873166099;36873166219", "11271539779;11271539779;11271539779");

        System.out.println(res);       */

        /*ReportManager rm = new ReportManager();
        rm.SetClientId("6431563602");*/

        //rm.GetAllReportsForClient("6431563602","C:\\L2T\\Import","2014-01-29");
        //rm.GetTotalReportForClient("6431563602","C:\\L2T\\Import");

        /*AdGroupManager am = new AdGroupManager();
        am.SetClientId("2040701763");

        String res = am.CreateAdGroup(file);

        System.out.println(res);

        am.Finalize();*/

        /*CampaignManager cm = new CampaignManager();

        cm.SetClientId("2040701763");
        String res = cm.UpdateCampaign(file);

        System.out.println(res);

        cm.Finalize(); */



        /*CampaignManager cm = new CampaignManager();
        cm.SetClientId("3312105275");

        String res = cm.CreateCampaign(file);

        System.out.println(res);

        cm.Finalize();*/

        /*CampaignManager cm = new CampaignManager();
        cm.SetClientId("2040701763");

        try{

        cm.GetCampaignReport(125353639L,"6863245671");
        }catch (Exception exc){
            exc.printStackTrace();
        }   */

        /*ReportManager rm = new ReportManager();
        try{

           // rm.GetAdReport("2040701763", "c:\\accounts");
            rm.GetCampaignKeywordsReport("2040701763","111507527", "c:\\accounts");

        //rm.GetAccountReport("2040701763", "c:\\accounts");
        }catch (Exception exc){
            exc.printStackTrace();
        }*/

        /*AdsManager adsManager = new AdsManager();

        adsManager.SetClientId("2040701763");

        String res = adsManager.CreateAdText(file);

        System.out.println(res);

        adsManager.Finalize(); */

       /* AdExtensionManager aem = new AdExtensionManager();

        aem.SetClientId("3151742820");
        String res = aem.CreateAdExtensionLocation(file);

        System.out.println(res);

        aem.Finalize();  */



        /*ReportManager rm = new ReportManager();

        rm.GetAllReports("2040701763", "c:\\accounts");     */





        /*ReportManager rm = new ReportManager();

        rm.GetAllReports("c:\\accounts");*/

        /*ReportManager rm = new ReportManager();
        rm.GetTotalReport("c:\\accounts");

          */

        /*ReportManager rm = new ReportManager();
        rm.GetAllProximitiesAndLanguagesForClient("2040701763","c:\\accounts");*/

        /*CampaignCriterionManager ccm = new CampaignCriterionManager();

        ccm.SetClientId("4202486077");

        ArrayList<ProximityReport> reports =  ccm.GetProximities(120473418L);

        String s = "";*/

        /*AdExtensionManager aem = new AdExtensionManager();
        aem.SetClientId("4223870253");

        String res = aem.CreateAdExtensionLocation(file);
        System.out.println(res);

        aem.Finalize();*/

        /*AdGroupCriterionManager acm = new AdGroupCriterionManager();

        acm.SetClientId("2040701763");

        String res = acm.CreateAdGroupCriterion(file);

        System.out.println(res);

        acm.Finalize();*/

        /*AdGroupCriterionManager acm = new AdGroupCriterionManager();
        acm.SetClientId("2040701763");
        String res = acm.DeleteAdGroupCriterion(50807175801L, 5301307727L);

        System.out.println(res);

        acm.Finalize();
        */

        /*CampaignManager cm = new CampaignManager();

        cm.SetClientId("4202486077");

        String res = cm.UpdateBudget(file);

        System.out.println(res);

        cm.Finalize(); */

        /*CampaignCriterionManager ccm = new CampaignCriterionManager();

        ccm.SetClientId("2098671267");

        String res = ccm.CreateCampaignCriterion(file);

        System.out.println(res);
        ccm.Finalize();
          */

        /*ReportManager rm = new ReportManager();
        rm.SetClientId("3994373251");
        rm.GetTotalReportForClient("3994373251", "C:\\");
        rm.Finalize();*/


                /*String file = "<GA_FeedItemCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<GA_FeedItem xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<FeedGxId>20</FeedGxId>\n" +
                "\t\t<FeedId>9130626</FeedId>\n" +
                "\t\t<FeedItemId>70629906</FeedItemId>\n" +
                "\t\t<FeedTypeId>1</FeedTypeId>\n" +
                "\t\t<SubCampaignGxId>188</SubCampaignGxId>\n" +
                "\t\t<AdExtensionGxId>835</AdExtensionGxId>\n" +
                "\t</GA_FeedItem>\n" +
                "</GA_FeedItemCollection>";       */




        // FeedManager fm = new FeedManager();

        //fm.SetClientId("6379640855");

        //String res = fm.GetAllFeeds();

        //String res = fm.GetFeedItems(9130626L);

        //String res = fm.DeleteFeedItems(file);

        //System.out.println(res);

        //fm.Finalize();

       /* ReportManager rm = new ReportManager();

        rm.SetClientId("9997248953");

        rm.GetAllReportsForClient("9997248953", "C:\\L2T", "20131126");

        rm.Finalize();  */

        /*ReportManager reportManager = new ReportManager();
        reportManager.SetClientId("3753007724");
        reportManager.GetTotalReportForClient("3753007724", "C:\\L2T\\Import\\");  */
    }

}
